using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Xml.Serialization;
using DeSleeper.Client.Properties;

namespace DeSleeper.Client.WakeUp
{
    [Serializable]
    [XmlInclude(typeof(ProxyWakeUpDestination))]
    [XmlInclude(typeof(LocalWakeUpDestination))]
    public abstract class WakeUpDestination : Freezable
    {
        public static IList<WakeUpDestination> All
        {
            get
            {
                if (Settings.Default.Destinations == null)
                       Settings.Default.Destinations = new List<WakeUpDestination> {new LocalWakeUpDestination()};
                return Settings.Default.Destinations;
            }
        }

        public abstract void WakeUp(TargetComputer targetComputer);

        protected abstract IEnumerable<WakeUpMethod> InnerMethods { get; }
        public IEnumerable<WakeUpMethod> Methods { get { return InnerMethods; } }

        /// <summary>
        /// A description of the target used to identify it to the user.
        /// </summary>
        public abstract string Description { get; }

        /// <summary>
        /// Identifier used to identify target to code.
        /// </summary>
        public abstract string Id { get; set; }
    }
}